<!-- File: app/views/dashboard/index.ctp -->
<div class="row-fluid sortable">		
	<div class="box span12">
		<div class="box-header" data-original-title>
			<h2><i class="halflings-icon user"></i><span class="break"></span>New staffs</h2>
			<div class="box-icon">
				<?php echo $this->Html->link('<i class="icon-podium"></i>', array('controller' => 'staffs', 'action' => 'add'), array('escape' => FALSE)); ?>
				<?php //echo $this->Html->link('<i class="halflings-icon remove"></i>', array('controller' => 'staffs', 'action' => 'index'), array('escape' => FALSE)); ?>
			</div>
		</div>
		
		<div class="box-content">
			<table class="table table-striped table-bordered bootstrap-datatable datatable">
		  		<tr>
					<th>ID</th>
					<th>Username</th>
					<th>Create Date</th>
					<th>Update Date</th>
					<th>Status</th>
					<th colspan="2" style="text-align: center;">Tools</th>
				</tr>
					
				  <?php foreach ($newstaffs as $data): ?>
				  <tr>
				    <td><?php echo $data['Staff']['staff_id']; ?></td>
				    <td>
				    <?php 
				      echo $this->Html->link($data['Staff']['username'],
				      array('controller' => 'staffs', 'action' => 'view_detail', 
				      $data['Staff']['staff_id']));
				    ?>
				    </td>
				    <td><?php echo (!empty($data['Staff']['create_date'])?$data['Staff']['create_date']:"Not yet"); ?></td>
				    <td><?php echo (!empty($data['Staff']['update_date'])?$data['Staff']['create_date']:"Not yet"); ?></td>
				    <td><?php echo ($data['Staff']['status']==1)?"<span class='label label-success'>Active</span>":"<span class='label label-important'>Banned</span>";?>
				    </td>
				    <td><?php echo $this->Html->link('<i class="icon-edit"></i> EDIT',array('action' => 'edit', $data['Staff']['staff_id']),array('escape' => FALSE));?></td>
				    <td><?php echo $this->Html->link('<i class="icon-remove"></i> DEL',array('action' => 'delete', $data['Staff']['staff_id']),array('escape' => FALSE),'Are you sure?')?></td>
				  </tr>
				  <?php endforeach; ?>
		  	</table>
		</div>
		<div class="box-header " data-original-title>
			<h2><i class="halflings-icon user"></i><span class="break"></span>New Customer</h2>
			<div class="box-icon">
				<?php //echo $this->Html->link('<i class="icon-plus"></i>', array('controller' => 'staffs', 'action' => 'add'), array('escape' => FALSE)); ?>
				<?php //echo $this->Html->link('<i class="halflings-icon remove"></i>', array('controller' => 'staffs', 'action' => 'index'), array('escape' => FALSE)); ?>
			</div>
		</div>
		<div class="box-content">
			<table class="table table-striped table-bordered bootstrap-datatable datatable">
		  		<tr>
					<th>ID</th>
					<th>Company Name</th>
					<th>Address</th>
					<th>Phone</th>
					<th colspan="2" style="text-align: center; width:111px;">Tools</th>
				</tr>
					
				  <?php foreach ($newscustomers as $data): ?>
				  <tr>
				    <td><?php echo $data['Customer']['customer_id']; ?></td>
				    <td>
				    <?php 
				      echo $this->Html->link($data['Customer']['company_name'],
				      array('controller' => 'customers', 'action' => 'view_detail', 
				      $data['Customer']['customer_id']));
				    ?>
				    </td>
				    <td><?php echo (!empty($data['Customer']['address'])?$data['Customer']['address']:"Not yet"); ?></td>
				    <td><?php echo (!empty($data['Customer']['phone'])?$data['Customer']['phone']:"Not yet"); ?></td>
				    <td><?php echo $this->Html->link('<i class="icon-edit"></i> EDIT',array('action' => 'edit', $data['Customer']['customer_id']),array('escape' => FALSE));?></td>
				    <td><?php echo $this->Html->link('<i class="icon-remove"></i> DEL',array('action' => 'delete', $data['Customer']['customer_id']),array('escape' => FALSE),'Are you sure?')?></td>
				  </tr>
				  <?php endforeach; ?>
		  	</table>
		  </div>
	</div><!--/span-->

</div><!--/row-->

